package ru.study.thinkin.chapter7;

class Villain {
	private String name;
	private Villain() {};
	
	protected void set(String name) {
		this.name = name;
	}
	public Villain(String name) {
		this.name = name;
	}
	public String toString() {
		return "Villian-"+name;
	}

}
public class Orc extends Villain{
	private int orcNumber;
	
	public Orc(String name,int orcNumber) {
		super(name);
		this.orcNumber=orcNumber;
	}
	public void change(String name,int orcNumber) {
		set(name);
		this.orcNumber=orcNumber;
	}
		
	@Override
	public String toString() {
		return "Orc [orcNumber=" + orcNumber + ", toString()="
				+ super.toString() + "]";
	}
	public static void main(String[] args) {
		    Orc orc =new Orc("Lim",12);
		    
		    System.out.println(orc);
		    orc.change("Arn", 99);
		    System.out.println(orc);

	}

}
